﻿
using System;
using System.Collections;

namespace Xacml.Core.Context
{
  public class AttributeValueElementCollection : AttributeValueElementCollectionReadWrite
  {
    public override AttributeValueElementReadWrite this[int index]
    {
      get
      {
        return (AttributeValueElementReadWrite) this.List[index];
      }
      set
      {
        throw new NotSupportedException();
      }
    }

    public AttributeValueElementCollection(AttributeValueElementCollectionReadWrite items)
    {
      foreach (AttributeValueElementReadWrite elementReadWrite in (CollectionBase) items)
        this.List.Add((object) new AttributeValueElement(elementReadWrite.Contents, elementReadWrite.SchemaVersion));
    }

    public AttributeValueElementCollection()
    {
    }

    public override void Clear()
    {
      throw new NotSupportedException();
    }

    public override int Add(AttributeValueElementReadWrite value)
    {
      return this.List.Add((object) new AttributeValueElement(value.Value, value.SchemaVersion));
    }

    public override void RemoveAt(int index)
    {
      throw new NotSupportedException();
    }
  }
}
